package com.xm.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xm.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


import java.util.Set;



public interface UserDao extends BaseMapper<User> {


    @Select(" SELECT rp.permission FROM users u JOIN user_roles ur JOIN" +
            " role_permissions rp ON u.id=ur.user_id AND ur.role_id=rp.role_id" +
            " WHERE u.id=#{id}")
    Set<String> selectPermissionById(Integer id);

    int insertUser(User user);



}
